package com.lky.project.mapper;

import com.lky.project.pojo.Pj;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【pj】的数据库操作Mapper
* @createDate 2023-04-29 23:03:10
* @Entity com.lky.project.pojo.Pj
*/
@Mapper
public interface PjMapper extends BaseMapper<Pj> {


    @Select("select p.*,DATE_FORMAT(p.time, '%Y-%m-%d %H:%i:%s') as ptime,u.name " +
            "from pj p " +
            "         left join `order` o on p.o_id = o.o_id " +
            "        left join user u on u.id = p.user_id " +
            " where o.s_id = ${sid} ")
    public List<Map> getPjBySid(@Param("sid") String sid);
}




